Skip to content

Implement SH1107 sleep/wake functionality #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 4, 2021
Merged

Implement SH1107 sleep/wake functionality #2

merged 12 commits into from
Feb 4, 2021

Conversation

SAK917
Copy link
Contributor

@SAK917 SAK917 commented Jan 29, 2021

Add sleep() and wake() methods and a state property to allow users to put the display into a power-saving mode. Uses the bus object passed to the SH1107 class at initialization to write to the device. Commands for entering and exiting sleep mode derived from the SH1107 datasheet.

Tested on a Feather M4 Express and SH1107 FeatherWing OLED 128x64 display.

Added:
  self._awake - stores current state of the display
  state - property that returns the current state
  sleep() - method that puts display to sleep
  wake() - method that wakes display from sleep
Received error during PR submission checks that the rev:
fields of the black and reuse-tool repos cannot be
mutable objects.  Changed rev from "latest" to the
current version numbers for each repo.
@evaherrada
Copy link
Collaborator

@SAK917 Looks like I forgot to update some stuff on this library. I'll do that tomorrow and then merge it with your fork which will hopefully make your PR pass.

PR check-in failed Pre-commit hooks test indicating
these files had missing copyright and licensing info.
Added headers as per @dherrada.
@evaherrada
Copy link
Collaborator

@SAK917 Just heard you're working on adding the licenses. That'd be greatly appreciated! If you've got any questions, feel free to ping me

@SAK917
Copy link
Contributor Author

SAK917 commented Jan 29, 2021

Just heard you're working on adding the licenses. That'd be greatly appreciated! If you've got any questions, feel free to ping me

@dherrada Happy to do what I can... thanks to a LOT of patience and help from @askpatrickw, I was able to muddle through all the changes the checks flagged. Most were for the supporting files, sorry for all the commits!

@evaherrada evaherrada requested a review from a team January 29, 2021 06:35
@evaherrada
Copy link
Collaborator

@SAK917 Great to see that it's passing!

Copy link

@askpatrickw askpatrickw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the code and the changes look straight-forward.
I do not have this device so did not test.

I suggest rebase and merge when approved.

@askpatrickw askpatrickw requested a review from a team January 29, 2021 18:28
@SAK917 SAK917 closed this Jan 31, 2021
@SAK917 SAK917 reopened this Jan 31, 2021
Changed name of display state property from
"active" to "is_awake" to clarify it refers to the
display state.
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One API suggestion.

Changed property name from state to is_awake
Made self._is_awake private
@SAK917 SAK917 requested a review from tannewt February 4, 2021 03:33
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@tannewt tannewt merged commit 59efbef into adafruit:main Feb 4, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants